//
//  HYOUHeadView.m
//  BestGift
//
//  Created by 温晓宇 on 16/1/11.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "HYOUHeadView.h"

@implementation HYOUHeadView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self createSubViews];
    }
    return self;
}
-(void)createSubViews{
    UIView *head = [[UIView alloc] initWithFrame:CGRectMake(0, 0, WIDTH, 64)];
    head.backgroundColor = RGBA(231, 46, 67, 1);
    [self addSubview:head];
    
    UIButton *left = [UIButton buttonWithType:UIButtonTypeCustom];
//    left.backgroundColor = [UIColor whiteColor];
    [left setImage:[UIImage imageNamed:@"iconfont-jiantou"] forState:UIControlStateNormal];
    left.frame = CGRectMake(10, 20, 32, 40);
    [self addSubview:left];
    [left addTarget:self action:@selector(leftAction:) forControlEvents:UIControlEventTouchUpInside];
}
-(void)leftAction:(UIButton *)btn{
    [self.delegate popView];
}
@end
